<%--
  Created by IntelliJ IDEA.
  User: 0xdF
  Date: 2022/11/9
  Time: 9:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<link rel="stylesheet" href="IdeaProjects/servlet_learn/web/sy6/css/layui.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<head>
    <jsp:include page="IdeaProjects/servlet_learn/web/sy6/head.jsp"/>
    <title>用户登录</title>
</head>
<body>
<div  style="margin: 20px 100px">
    <form action="./login.do" method="post" >
        <br>
        <label class="layui-form-label" style="font-weight: bolder;font-size: 20px">用户登录</label>
        <div class="layui-form-item">
            <label class="layui-form-label">账号</label>
            <div class="layui-input-inline">
                <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="请输入账号" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" lay-verify="title" autocomplete="off" placeholder="请输入密码" class="layui-input">
            </div>
        </div>
        <div style="display: inline-block">
            <input type="submit" class="layui-btn layui-btn-danger" value="登录" style="margin-left: 150px">
            <input type="reset" class="layui-btn layui-btn-normal" value="重置" style="">
        </div>
    </form>

</div>
<%
    String errMSg = (String)session.getAttribute("error");
    String sucMSg = (String)session.getAttribute("success");
    if(errMSg!=null){
        out.print("<script>alert(\""+errMSg+"\");</script>");
        session.removeAttribute("error");
    }
    if(sucMSg!=null){
        out.print("<script>alert(\""+sucMSg+"\");</script>");
        session.removeAttribute("success");
    }
%>
</body>
</html>
